<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>embedme: libemb/inc/Timer.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.8 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>文件成员</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_574d9269cd334a9d02d8928365303d98.html">libemb</a></li><li class="navelem"><a class="el" href="dir_207aad82934689048a9003fb51f06f7f.html">inc</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Timer.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_timer_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * This file is part of libemb.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * libemb is free software: you can redistribute it and/or modify</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * the Free Software Foundation, either version 3 of the License, or</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * (at your option) any later version.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * libemb is distributed in the hope that it will be useful,</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * GNU General Public License for more details.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * along with libemb.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * Project: Embedme</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * Author : FergusZeng</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * Email  : cblock@126.com</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * git    : https://git.oschina.net/cblock/embedme</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> * Copyright 2014 @ ShenZhen ,China</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">*******************************************************************************/</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#ifndef __TIMER_H__</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#define __TIMER_H__</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_rtc_facade_8h.html">RtcFacade.h</a>&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_event_8h.html">Event.h</a>&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_thread_8h.html">Thread.h</a>&quot;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_mutex_8h.html">Mutex.h</a>&quot;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &lt;list&gt;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;{</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    TIMER_TYPE_PERIODIC,</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    TIMER_TYPE_ONESHOT,</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;}TIMER_TYPE_E;</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;{</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    TIME_UNIT_MILLISECOND,</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    TIME_UNIT_SECOND,</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    TIME_UNIT_MINUTE,</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    TIME_UNIT_HOUR,</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    TIME_UNIT_DAY,</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;}TIME_UNIT_E;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="keyword">class </span><a class="code" href="class_timer_manager.html">TimerManager</a>;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="class_timer.html">   56</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_timer.html">Timer</a>{</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <a class="code" href="class_timer.html">Timer</a>(<a class="code" href="struct_rtc_time___s.html">RtcTime_S</a> absTime);</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <a class="code" href="class_timer.html">Timer</a>(uint32 interval,TIME_UNIT_E unit);</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_timer.html#a83a686df8682138c723b366d13bcdb00">msDelay</a>(uint32 ms);</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="class_timer.html">Timer</a>();</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    sint32 reset();</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> onTimer()=0;</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <span class="keywordtype">void</span> onTick();</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    TIMER_TYPE_E m_type;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    uint32 m_event;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keywordtype">bool</span> m_isAbsTimer;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <a class="code" href="struct_rtc_time___s.html">RtcTime_S</a> m_absTime;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    sint32 m_timerMS;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    uint32 m_interval;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    TIME_UNIT_E m_unit;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keywordtype">bool</span> m_isExpired;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_timer_manager.html">TimerManager</a>;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;};</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="class_periodic_timer.html">   84</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_periodic_timer.html">PeriodicTimer</a>:<span class="keyword">public</span> <a class="code" href="class_timer.html">Timer</a>{</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <a class="code" href="class_periodic_timer.html">PeriodicTimer</a>(<a class="code" href="struct_rtc_time___s.html">RtcTime_S</a> absTime, uint32 event);</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <a class="code" href="class_periodic_timer.html">PeriodicTimer</a>(uint32 interval,TIME_UNIT_E unit, uint32 event);</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    ~<a class="code" href="class_periodic_timer.html">PeriodicTimer</a>();</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="keywordtype">void</span> onTimer();</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;};</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div>
<div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="class_one_shot_timer.html">   98</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_one_shot_timer.html">OneShotTimer</a>:<span class="keyword">public</span> <a class="code" href="class_timer.html">Timer</a>{</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <a class="code" href="class_one_shot_timer.html">OneShotTimer</a>(<a class="code" href="struct_rtc_time___s.html">RtcTime_S</a> absTime, uint32 event);</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <a class="code" href="class_one_shot_timer.html">OneShotTimer</a>(uint32 interval,TIME_UNIT_E unit, uint32 event);</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    ~<a class="code" href="class_one_shot_timer.html">OneShotTimer</a>();</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="keywordtype">void</span> onTimer();</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;};</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="class_timer_manager.html">  112</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_timer_manager.html">TimerManager</a>:<span class="keyword">public</span> <a class="code" href="class_runnable_protocol.html">RunnableProtocol</a>{</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00120"></a><span class="lineno"><a class="line" href="class_timer_manager.html#a106e7cf660ed9e56c0de7c964cd34f92">  120</a></span>&#160;    <span class="keyword">static</span> <a class="code" href="class_timer_manager.html">TimerManager</a>* <a class="code" href="class_timer_manager.html#a106e7cf660ed9e56c0de7c964cd34f92">getInstance</a>()</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    {</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        <span class="keyword">static</span> <a class="code" href="class_timer_manager.html">TimerManager</a> instance;</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        <span class="keywordflow">return</span> &amp;instance;</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    }</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    ~<a class="code" href="class_timer_manager.html">TimerManager</a>();</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    sint32 <a class="code" href="class_timer_manager.html#a551ecad43e1b14a59d4607a319e45d79">addTimer</a>(<a class="code" href="class_timer.html">Timer</a>* timer);      <span class="comment">/* 增加定时器 */</span></div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    sint32 <a class="code" href="class_timer_manager.html#a53589574dd8967d703e8bedf0f9888f8">removeTimer</a>(<a class="code" href="class_timer.html">Timer</a>* timer);   <span class="comment">/* 移除定时器 */</span></div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    sint32 <a class="code" href="class_timer_manager.html#ad75a33efff8721ef803f7d7f3c64a2c6">restartTimer</a>(<a class="code" href="class_timer.html">Timer</a>* timer);  <span class="comment">/* 重新启用定时器 */</span></div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <a class="code" href="class_timer_manager.html">TimerManager</a>();</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    <span class="keywordtype">void</span> run();</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <a class="code" href="class_mutex_lock.html">MutexLock</a> m_listLock;</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <a class="code" href="class_thread.html">Thread</a> m_timerThread;</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    std::list&lt;Timer*&gt; m_timerList;</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;};</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;</div>
<div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="class_c_timer_protocol.html">  143</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_c_timer_protocol.html">CTimerProtocol</a>{</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    <a class="code" href="class_c_timer_protocol.html">CTimerProtocol</a>(){};</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="class_c_timer_protocol.html">CTimerProtocol</a>(){};</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_timer_protocol.html#a7b1989a52efad572443b047f27cd5af6">onCTimer</a>(sint32 timerId);</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;};</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;<span class="keyword">typedef</span> void (<a class="code" href="class_c_timer_protocol.html">CTimerProtocol</a>::*SEL_onctimer)();</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="preprocessor">#define ctimer_selector(SELECTOR) (SEL_onctimer)(&amp;SELECTOR)</span></div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;</div>
<div class="line"><a name="l00158"></a><span class="lineno"><a class="line" href="class_c_timer.html">  158</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_c_timer.html">CTimer</a>:<span class="keyword">public</span> <a class="code" href="class_runnable_protocol.html">RunnableProtocol</a>{</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    <a class="code" href="class_c_timer.html">CTimer</a>(sint32 <span class="keywordtype">id</span>,<a class="code" href="class_c_timer_protocol.html">CTimerProtocol</a>*owner);</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    ~<a class="code" href="class_c_timer.html">CTimer</a>();</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    sint32 <a class="code" href="class_c_timer.html#af869bfb6ded2b04e3149c663325fd737">start</a>(sint32 interval,sint32 unit,SEL_onctimer ontime=NULL);</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    sint32 <a class="code" href="class_c_timer.html#a69c2fc2baf8a1a3c9987b1a7b0679c3d">stop</a>();</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    sint32 getId(){<span class="keywordflow">return</span> m_timerId;}</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;    <span class="keywordtype">void</span> run();</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    sint32 m_timerId;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    <span class="keywordtype">bool</span> m_startFlag;</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    sint32 m_timerMS;</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    sint32 m_timeLeft;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    <a class="code" href="class_thread.html">Thread</a> m_mainThread;</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    <a class="code" href="class_c_timer_protocol.html">CTimerProtocol</a>* m_owner;</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;    SEL_onctimer m_ontime;</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;};</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="class_c_timer_html_af869bfb6ded2b04e3149c663325fd737"><div class="ttname"><a href="class_c_timer.html#af869bfb6ded2b04e3149c663325fd737">CTimer::start</a></div><div class="ttdeci">sint32 start(sint32 interval, sint32 unit, SEL_onctimer ontime=NULL)</div><div class="ttdoc">启用定时器 </div><div class="ttdef"><b>Definition:</b> Timer.cpp:312</div></div>
<div class="ttc" id="class_timer_manager_html_ad75a33efff8721ef803f7d7f3c64a2c6"><div class="ttname"><a href="class_timer_manager.html#ad75a33efff8721ef803f7d7f3c64a2c6">TimerManager::restartTimer</a></div><div class="ttdeci">sint32 restartTimer(Timer *timer)</div><div class="ttdoc">重新启用定时器 </div><div class="ttdef"><b>Definition:</b> Timer.cpp:251</div></div>
<div class="ttc" id="class_timer_html"><div class="ttname"><a href="class_timer.html">Timer</a></div><div class="ttdoc">定时器基类(基于事件消息的定时器) </div><div class="ttdef"><b>Definition:</b> Timer.h:56</div></div>
<div class="ttc" id="class_c_timer_protocol_html"><div class="ttname"><a href="class_c_timer_protocol.html">CTimerProtocol</a></div><div class="ttdoc">CTimer定时回调接口 </div><div class="ttdef"><b>Definition:</b> Timer.h:143</div></div>
<div class="ttc" id="class_periodic_timer_html"><div class="ttname"><a href="class_periodic_timer.html">PeriodicTimer</a></div><div class="ttdoc">周期定时器类 </div><div class="ttdef"><b>Definition:</b> Timer.h:84</div></div>
<div class="ttc" id="class_c_timer_html"><div class="ttname"><a href="class_c_timer.html">CTimer</a></div><div class="ttdoc">独占定时器类(基于C回调函数的定时器,每个定时器独占一个线程) </div><div class="ttdef"><b>Definition:</b> Timer.h:158</div></div>
<div class="ttc" id="class_thread_html"><div class="ttname"><a href="class_thread.html">Thread</a></div><div class="ttdoc">线程类 </div><div class="ttdef"><b>Definition:</b> Thread.h:66</div></div>
<div class="ttc" id="class_timer_manager_html_a106e7cf660ed9e56c0de7c964cd34f92"><div class="ttname"><a href="class_timer_manager.html#a106e7cf660ed9e56c0de7c964cd34f92">TimerManager::getInstance</a></div><div class="ttdeci">static TimerManager * getInstance()</div><div class="ttdoc">获取TimerManager单例 </div><div class="ttdef"><b>Definition:</b> Timer.h:120</div></div>
<div class="ttc" id="_rtc_facade_8h_html"><div class="ttname"><a href="_rtc_facade_8h.html">RtcFacade.h</a></div></div>
<div class="ttc" id="struct_rtc_time___s_html"><div class="ttname"><a href="struct_rtc_time___s.html">RtcTime_S</a></div><div class="ttdoc">时间结构体 </div><div class="ttdef"><b>Definition:</b> RtcFacade.h:31</div></div>
<div class="ttc" id="class_timer_manager_html_a53589574dd8967d703e8bedf0f9888f8"><div class="ttname"><a href="class_timer_manager.html#a53589574dd8967d703e8bedf0f9888f8">TimerManager::removeTimer</a></div><div class="ttdeci">sint32 removeTimer(Timer *timer)</div><div class="ttdoc">移除定时器 </div><div class="ttdef"><b>Definition:</b> Timer.cpp:230</div></div>
<div class="ttc" id="class_timer_html_a83a686df8682138c723b366d13bcdb00"><div class="ttname"><a href="class_timer.html#a83a686df8682138c723b366d13bcdb00">Timer::msDelay</a></div><div class="ttdeci">static void msDelay(uint32 ms)</div><div class="ttdoc">毫秒延时函数 </div><div class="ttdef"><b>Definition:</b> Timer.cpp:52</div></div>
<div class="ttc" id="_thread_8h_html"><div class="ttname"><a href="_thread_8h.html">Thread.h</a></div></div>
<div class="ttc" id="_event_8h_html"><div class="ttname"><a href="_event_8h.html">Event.h</a></div></div>
<div class="ttc" id="class_mutex_lock_html"><div class="ttname"><a href="class_mutex_lock.html">MutexLock</a></div><div class="ttdoc">互斥锁类 </div><div class="ttdef"><b>Definition:</b> Mutex.h:35</div></div>
<div class="ttc" id="_mutex_8h_html"><div class="ttname"><a href="_mutex_8h.html">Mutex.h</a></div></div>
<div class="ttc" id="class_runnable_protocol_html"><div class="ttname"><a href="class_runnable_protocol.html">RunnableProtocol</a></div><div class="ttdoc">线程接口 </div><div class="ttdef"><b>Definition:</b> Thread.h:36</div></div>
<div class="ttc" id="class_c_timer_html_a69c2fc2baf8a1a3c9987b1a7b0679c3d"><div class="ttname"><a href="class_c_timer.html#a69c2fc2baf8a1a3c9987b1a7b0679c3d">CTimer::stop</a></div><div class="ttdeci">sint32 stop()</div><div class="ttdoc">停止定时器 </div><div class="ttdef"><b>Definition:</b> Timer.cpp:354</div></div>
<div class="ttc" id="class_timer_manager_html_a551ecad43e1b14a59d4607a319e45d79"><div class="ttname"><a href="class_timer_manager.html#a551ecad43e1b14a59d4607a319e45d79">TimerManager::addTimer</a></div><div class="ttdeci">sint32 addTimer(Timer *timer)</div><div class="ttdoc">增加定时器 </div><div class="ttdef"><b>Definition:</b> Timer.cpp:207</div></div>
<div class="ttc" id="class_c_timer_protocol_html_a7b1989a52efad572443b047f27cd5af6"><div class="ttname"><a href="class_c_timer_protocol.html#a7b1989a52efad572443b047f27cd5af6">CTimerProtocol::onCTimer</a></div><div class="ttdeci">virtual void onCTimer(sint32 timerId)</div><div class="ttdoc">默认CTimer定时器回调 </div><div class="ttdef"><b>Definition:</b> Timer.cpp:289</div></div>
<div class="ttc" id="class_one_shot_timer_html"><div class="ttname"><a href="class_one_shot_timer.html">OneShotTimer</a></div><div class="ttdoc">一次性定时器类 </div><div class="ttdef"><b>Definition:</b> Timer.h:98</div></div>
<div class="ttc" id="class_timer_manager_html"><div class="ttname"><a href="class_timer_manager.html">TimerManager</a></div><div class="ttdoc">定时器管理类 </div><div class="ttdef"><b>Definition:</b> Timer.h:112</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2016年 七月 7日 星期四 19:49:37 , 为 embedme使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>
